package com.szqhyxj.youxiangju.biz.partnerHome.equipment;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentManager;
import android.support.v4.app.FragmentTransaction;
import android.view.View;
import android.widget.FrameLayout;
import android.widget.TextView;

import com.szqhyxj.youxiangju.BaseActivity;
import com.szqhyxj.youxiangju.R;
import com.szqhyxj.youxiangju.biz.partnerHome.equipment.currentRecord.CurrentRecordActivity;
import com.szqhyxj.youxiangju.biz.web.WebActivity;
import com.szqhyxj.youxiangju.sys.components.NavigationBar;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

/**
 * 设备管理
 */
public class PartnerEquipmentActivity extends BaseActivity implements NavigationBar.NavigationBarListener {

    @BindView(R.id.navigationBar)
    NavigationBar navigationBar;
    @BindView(R.id.record)
    TextView record;
    @BindView(R.id.container)
    FrameLayout container;

    public static void start(Activity activity) {
        Intent intent = new Intent();
        intent.setClass(activity, PartnerEquipmentActivity.class);
        activity.startActivity(intent);
    }

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_partner_equipment);
        ButterKnife.bind(this);
        FragmentManager fragmentManager = getSupportFragmentManager();
        PartnerEquipmentFragment fragment = PartnerEquipmentFragment.newInstance();
        final FragmentTransaction transaction = fragmentManager.beginTransaction();
        transaction.add(R.id.container, fragment);
        transaction.show(fragment);
        transaction.commit();
        navigationBar.setNavigationBarListener(this);
    }

    @Override
    public void navigationLeft() {
        finish();
    }

    @Override
    public void navigationRight() {
    }



    @OnClick({R.id.flowrecord, R.id.record})
    public void onClick(View view) {
        switch (view.getId()) {
            case R.id.flowrecord:
                WebActivity.startToH5(this,"flowRecord");
                break;
            case R.id.record:
                CurrentRecordActivity.start(this);
                break;
        }
    }
}
